import request from '@/utils/request'

export function fetchTenants(params) {
  return request({
    url: '/api/v1/tenants',
    method: 'get',
    params
  })
}

export function getUserTenants(params) {
  return request({
    url: '/api/v1/tenants/user',
    method: 'get',
    params
  })
}

export function addTenant(data) {
  return request({
    url: '/api/v1/tenants',
    method: 'post',
    data
  })
}

export function updateTenant(id, data) {
  return request({
    url: `/api/v1/tenants/${id}`,
    method: 'put',
    data
  })
}

export function deleteTenant(id) {
  return request({
    url: `/api/v1/tenants/${id}`,
    method: 'delete'
  })
}
